#define PIN_CAR_IN1 5  
#define PIN_CAR_IN2 6  
#define PIN_CAR_IN3 9  
#define PIN_CAR_IN4 10  
  
void doForward() {  
  digitalWrite(PIN_CAR_IN3,LOW);  
  digitalWrite(PIN_CAR_IN4,HIGH);  
  digitalWrite(PIN_CAR_IN1,LOW);  
  digitalWrite(PIN_CAR_IN2,HIGH);  
}  
  
void doBackward() {  
  digitalWrite(PIN_CAR_IN3,HIGH);  
  digitalWrite(PIN_CAR_IN4,LOW);  
  digitalWrite(PIN_CAR_IN1,HIGH);  
  digitalWrite(PIN_CAR_IN2,LOW);  
}  
  
void doStop() {  
  digitalWrite(PIN_CAR_IN3,LOW);  
  digitalWrite(PIN_CAR_IN4,LOW);  
  digitalWrite(PIN_CAR_IN1,LOW);  
  digitalWrite(PIN_CAR_IN2,LOW);  
  
  digitalWrite(PIN_CAR_IN3,HIGH);  
  digitalWrite(PIN_CAR_IN4,HIGH);  
  digitalWrite(PIN_CAR_IN1,HIGH);  
  digitalWrite(PIN_CAR_IN2,HIGH);  
}  
  
void doLeft() {  
  digitalWrite(PIN_CAR_IN3,HIGH);  
  digitalWrite(PIN_CAR_IN4,LOW);  
  digitalWrite(PIN_CAR_IN1,LOW);  
  digitalWrite(PIN_CAR_IN2,HIGH);     
}  
  
void doRight() {  
  digitalWrite(PIN_CAR_IN3,LOW);  
  digitalWrite(PIN_CAR_IN4,HIGH);  
  digitalWrite(PIN_CAR_IN1,HIGH);  
  digitalWrite(PIN_CAR_IN2,LOW);  
}  
  
void setup()  
{  
  pinMode(PIN_CAR_IN1,OUTPUT);  
  pinMode(PIN_CAR_IN2,OUTPUT);  
  pinMode(PIN_CAR_IN3,OUTPUT);  
  pinMode(PIN_CAR_IN4,OUTPUT);  
  
  digitalWrite(PIN_CAR_IN1, OUTPUT);  
  digitalWrite(PIN_CAR_IN2, OUTPUT);  
  digitalWrite(PIN_CAR_IN3, OUTPUT);  
  digitalWrite(PIN_CAR_IN4, OUTPUT);  
  
  Serial.begin(9600);  
}  
  
void loop()  
{  
  doForward();  
   
}  
